//
//  JTPushNotification.m
//  JiongTu
//
//  Created by 杨璟 on 16/4/28.
//  Copyright © 2016年 YSKJ. All rights reserved.
//

#import "JTPushNotification.h"

#import <MJExtension.h>

@implementation JTPushNotification

MJExtensionCodingImplementation

+ (instancetype)notificationWithRemoteNotification:(NSDictionary *)userInfo {
    JTPushNotification *notif = [[JTPushNotification alloc] init];
    notif.alertInfo = userInfo[@"aps"][@"alert"];
    notif.identity = userInfo[@"identity"];
    notif.userId = userInfo[@"userId"];
    if ([userInfo[@"identity"] isEqualToString:@"乘客"]) {
        notif.passengerTripId = userInfo[@"tripId"];
    } else if ([userInfo[@"identity"] isEqualToString:@"司机"]) {
        notif.driverTripId = userInfo[@"tripId"];
    }
    return notif;
}

@end
